/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tofc.chart;

import tofc.value.CandleCol;
import java.util.ArrayList;
import java.util.List;

/**
 * CandleChart:
 * @author zzn
 */
public class Candle extends BaseXYChart {

    private List<CandleCol> values;
    private String colour;
    private String negativeColour;
    private Number alpha;
    private String tip;
    private String type;

    /**
     *
     */
    public Candle() {
        this.type = "candle";
        this.values = new ArrayList();
    }

    /**
     *
     * @return
     */
    public Number getAlpha() {
        return alpha;
    }

    /**
     *
     * @param alpha
     */
    public void setAlpha(Number alpha) {
        this.alpha = alpha;
    }

    /**
     *
     * @return
     */
    public String getColour() {
        return colour;
    }

    /**
     *
     * @param colour
     */
    public void setColour(String colour) {
        this.colour = colour;
    }

    /**
     *
     * @return
     */
    public String getNegativeColour() {
        return negativeColour;
    }

    /**
     *
     * @param negativeColour
     */
    public void setNegativeColour(String negativeColour) {
        this.negativeColour = negativeColour;
    }

    /**
     *
     * @return
     */
    public String getTip() {
        return tip;
    }

    /**
     *
     * @param tip
     */
    public void setTip(String tip) {
        this.tip = tip;
    }

    /**
     *
     * @return
     */
    public String getType() {
        return type;
    }

    /**
     *
     * @param type
     */
    public void setType(String type) {
        this.type = type;
    }

    /**
     *
     * @return
     */
    public List<CandleCol> getValues() {
        return values;
    }

    /**
     *
     * @param values
     */
    public void setValues(List<CandleCol> values) {
        this.values = values;
    }

    /**
     *
     * @param values
     */
    public void setValues(CandleCol... values) {
        this.values.clear();
        addValues(values);
    }

    /**
     *
     * @param values
     */
    public void addValues(CandleCol... values) {
        for (int i = 0; i < values.length; i++) {
            this.values.add(values[i]);
        }
    }

    /**
     *
     * @param position
     * @param value
     */
    public void setValue(int position, CandleCol value) {
        this.values.set(position, value);
    }


    /**
     * add 'null' to the end of the value list
     */
    public void appendNull() {
        this.values.add(null);
    }

    /**
     * set 'null'
     * e.g. values.addValues(1,2,3,4);
     *      values.setNull(2);
     * result: {1,2,null,4}
     * @param index
     */
    public void setNull(int index) {
        this.values.set(index, null);
    }
}
